import request from '@/utils/request'
// import request from './request'

export function getHabits(userId) {
  return request({
    url: `/api/habits/user/${userId}`,
    method: 'get'
  })
}

export function createHabit(data) {
  return request({
    url: '/api/habits',
    method: 'post',
    data
  })
}

export function updateHabit(id, data) {
  return request({
    url: `/api/habits/${id}`,
    method: 'put',
    data
  })
}

export function deleteHabit(id) {
  return request({
    url: `/api/habits/${id}`,
    method: 'delete'
  })
}

export function checkHabit(id) {
  return request.post(`/habits/${id}/check`)
} 